package com.yww.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yww.entity.Roles;
import com.yww.entity.UserRoles;
import com.yww.mapper.UserRolesMapper;
import com.yww.service.IUserRolesService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 杨雯雯
 * @since 2020-05-20
 */
@Service
public class UserRolesServiceImpl extends ServiceImpl<UserRolesMapper, UserRoles> implements IUserRolesService {
    @Resource
    UserRolesMapper userRolesMapper;

    @Override
    public List<Roles> getRolesListByUserId(Integer userId) {
        return userRolesMapper.getRolesListByUserId(userId);
    }

    @Override
    public boolean delRolesBatchByUserId(Integer userId, String ids) {
        return userRolesMapper.delRolesBatchByUserId(userId,ids.split(","));
    }
}
